home *** CD-ROM | disk | FTP | other *** search
- #include <graphics.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <conio.h>
- #include <dos.h>
-
- // POOF! v1.0 programmed by David A. Scouten
- // for 1993 WDM Software Publications
-
- // prototype definition(s)
- void airbag(void);
- void wdmlogo(void);
- void syscrash(void);
-
- void main() { //start main function
- int count=5;
-
- // request auto detection
- int gdriver = DETECT, gmode, errorcode;
-
- // initialize graphics mode
- initgraph(&gdriver, &gmode, "egavga.bgi");
-
- //read result of initialization
- errorcode = graphresult();
-
- if (errorcode != grOk) { //an error occurred
- printf("Graphics error: %s\n", grapherrormsg(errorcode));
- printf("Press any key to halt:");
- getch();
- }
- else
- { // actual program begins
-
- printf("\n\t\t\t\tCountdown\n\t\t");
- while (count!=-1) {
- printf("%d\t",count);
- delay(1000);
- count--;
- }
-
- printf("\n\n\n\n\t\t\tAir Bag device activated!!");
- delay(2500);
-
- cleardevice();
- airbag();
- wdmlogo();
- syscrash();
-
- // clean up
- getch();
- closegraph();
- }
- }// end main function
-
- // function airbag
- void airbag(void) {
- int num, xpos=320, ypos=235;
- setbkcolor(RED);
- for (num=50;num<=250;num+=20) {
- setcolor(WHITE);
- fillellipse(xpos,ypos,num,num);
- sound(num);
- setcolor(LIGHTGREEN);
- outtextxy(xpos-15,ypos,"POOF!!");
- }
- nosound();
- }// end airbag
-
- // function wdmlogo
- void wdmlogo(void) {
- int xpos=320, ypos=235;
- setcolor(LIGHTBLUE);
- outtextxy(xpos-115,ypos+230,"1993 WDM Software Publications");
- }// end wdmlogo
-
- // function syscrash
- void syscrash(void) {
- int colr;
- LOOP:
-
- for (colr=0;colr<=15;colr++) {
- setbkcolor(colr);
- delay(10);
- }
-
- goto LOOP;
-
- } // end syscrash